package entity.lemming.animation;

import entity.Entity;
import entity.lemming.Lemming;

/**
 * A lemming that falls to the floor.
 * 
 * @author Neil Cowzer
 */
public class Falling extends Lemming {

	/** 
	 * Boolean value whether the fall has exceeded a certain height
	 * and shall be fatal for the Lemming.
	 */
	private boolean fatal;
	
	/** Integer value afterwhich a fall is fatal */
	private int maxFall;
	//@ invariant maxFall > 0;
	
	/** intial y-coordinate from which the lemming fell */
	private int startY;
	
	
	/**
	 * 
	 * @param x the starting x-coordinate.
	 * @param y the starting y-coordinate.
	 */
	/*@ requires 0 <= x && 0 <= y;
		assignable speed_X && speed_Y && energy && startX;
		ensures speed_X == 0 && speed_Y < 0 && energy == 100;
	 @*/
	public Falling(int x, int y){
		super("tobefilled.gif", x, y);
		startY = y;
		speed_X = 0;
		speed_Y = -1;
		energy = 100;
		fatal = false;
	}
	
	/**
	 * Checks for a collision with another Entity
	 * 
	 * @param other another Entity eg Terrain, Lemming.
	 * @return true if a collision has occured.
	 */
	public /*@ pure @*/ boolean collision(Entity other) {
		// TODO Auto-generated method stub
		return false;
	}
	
	/**
	 * Checks if a fall is fatal.
	 * 
	 * @return boolean value if fall should be fatal.
	 */
	public /*@ pure @*/ boolean fatal() {
		return fatal;
	}

	/** Request that this lemming perform the appropiate action/movement. */
	/*@ ensures x == \old(x) &&
	 * 			y == \old(y) + speed_Y &&
				energy == \old(energy);
		assignable fatal;
	 @*/
	public void move() {
		// TODO Auto-generated method stub

	}
	
	/** Override turnAround. */
	public void turnAround(){
		// do nothing!
	}

}
